
function then(){
    console.log(1)
    let promise2 = (function(){
        console.log(2)
        queueMicrotask(()=>{
            console.log(3)
            console.log(promise2)
        });
        return 'promise2';
    })();
    console.log(4)
}
then();
//ReferenceError: Cannot access 'promise2' before initialization